Optimal. Leaf size=110 \[ \frac {2 x \sqrt {\cos \left (a+b \log \left (c x^n\right )\right )} \, _2F_1\left (-\frac {1}{2},-\frac {2 i+b n}{4 b n};\frac {1}{4} \left (3-\frac {2 i}{b n}\right );-e^{2 i a} \left (c x^n\right )^{2 i b}\right )}{(2-i b n) \sqrt {1+e^{2 i a} \left (c x^n\right )^{2 i b}}} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.05, antiderivative size = 110, normalized size of antiderivative = 1.00, number of steps
used = 3, number of rules used = 3, integrand size = 15, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.200, Rules used = {4572, 4580,
371} \begin {gather*} \frac {2 x \, _2F_1\left (-\frac {1}{2},-\frac {b n+2 i}{4 b n};\frac {1}{4} \left (3-\frac {2 i}{b n}\right );-e^{2 i a} \left (c x^n\right )^{2 i b}\right ) \sqrt {\cos \left (a+b \log \left (c x^n\right )\right )}}{(2-i b n) \sqrt {1+e^{2 i a} \left (c x^n\right )^{2 i b}}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 371
Rule 4572
Rule 4580
Rubi steps
\begin {align*} \int \sqrt {\cos \left (a+b \log \left (c x^n\right )\right )} \, dx &=\frac {\left (x \left (c x^n\right )^{-1/n}\right ) \text {Subst}\left (\int x^{-1+\frac {1}{n}} \sqrt {\cos (a+b \log (x))} \, dx,x,c x^n\right )}{n}\\ &=\frac {\left (x \left (c x^n\right )^{\frac {i b}{2}-\frac {1}{n}} \sqrt {\cos \left (a+b \log \left (c x^n\right )\right )}\right ) \text {Subst}\left (\int x^{-1-\frac {i b}{2}+\frac {1}{n}} \sqrt {1+e^{2 i a} x^{2 i b}} \, dx,x,c x^n\right )}{n \sqrt {1+e^{2 i a} \left (c x^n\right )^{2 i b}}}\\ &=\frac {2 x \sqrt {\cos \left (a+b \log \left (c x^n\right )\right )} \, _2F_1\left (-\frac {1}{2},-\frac {2 i+b n}{4 b n};\frac {1}{4} \left (3-\frac {2 i}{b n}\right );-e^{2 i a} \left (c x^n\right )^{2 i b}\right )}{(2-i b n) \sqrt {1+e^{2 i a} \left (c x^n\right )^{2 i b}}}\\ \end {align*}
________________________________________________________________________________________
Mathematica [B] Both result and optimal contain complex but leaf count is larger than twice
the leaf count of optimal. \(361\) vs. \(2(110)=220\).
time = 5.54, size = 361, normalized size = 3.28 \begin {gather*} \frac {2 i \sqrt {2} b e^{-i a} n x \left (c x^n\right )^{-i b} \left ((2 i+b n) \left (1+e^{2 i a} \left (c x^n\right )^{2 i b}\right )+\sqrt {1+e^{2 i a} \left (c x^n\right )^{2 i b}} \left (-2 i-b n+e^{2 i a} (-2 i+b n) x^{-2 i b n} \left (c x^n\right )^{2 i b}\right ) \, _2F_1\left (\frac {1}{2},-\frac {2 i+b n}{4 b n};\frac {3}{4}-\frac {i}{2 b n};-e^{2 i a} \left (c x^n\right )^{2 i b}\right )\right )}{\left (4+b^2 n^2\right ) \sqrt {e^{-i a} \left (c x^n\right )^{-i b}+e^{i a} \left (c x^n\right )^{i b}} \left (-2 i-b n+e^{2 i a} (-2 i+b n) x^{-2 i b n} \left (c x^n\right )^{2 i b}\right )}-\frac {2 x \sqrt {\cos \left (a+b \log \left (c x^n\right )\right )} \cos \left (a-b n \log (x)+b \log \left (c x^n\right )\right )}{-2 \cos \left (a-b n \log (x)+b \log \left (c x^n\right )\right )+b n \sin \left (a-b n \log (x)+b \log \left (c x^n\right )\right )} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [F]
time = 0.03, size = 0, normalized size = 0.00 \[\int \sqrt {\cos }\left (a +b \ln \left (c \,x^{n}\right )\right )\, dx\]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: TypeError} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \sqrt {\cos {\left (a + b \log {\left (c x^{n} \right )} \right )}}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [F]
time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} \int \sqrt {\cos \left (a+b\,\ln \left (c\,x^n\right )\right )} \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________